import App from './App'
// 条件编译
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
//引入uview组件库
import uView from "uview-ui";
Vue.use(uView);

//全局注册自定义组件
import MyComponent from 'components/test-my-component.vue'
Vue.component('test-my-component',MyComponent)
import NavCustom from 'components/nav-custom.vue'
Vue.component('nav-custom',NavCustom)
import HomeTitle from 'components/home-title.vue'
Vue.component('home-title',HomeTitle)
import GoodItem from 'components/good-item.vue'
Vue.component('good-item',GoodItem)
import TabCustom from 'components/tab-custom.vue'
Vue.component('tab-custom',TabCustom)
import GoodSpec from 'components/good-spec.vue'
Vue.component('good-spec',GoodSpec)
import CuCustom from 'colorui/components/cu-custom.vue'
Vue.component('cu-custom',CuCustom)

// 挂载异步请求方法
// import {$http,$get,$post} from 'utils/request.js'
// Vue.prototype.$http = $http
// Vue.prototype.$get = $get
// Vue.prototype.$post = $post
import * as request from 'utils/request.js'
for(let attr in request){
	Vue.prototype[attr] = request[attr]
}

import store from './store/index.js'

const app = new Vue({
	store, //注入状态机
    ...App
})
// 引入请求封装，将app参数传递到配置中
require('utils/uview-request.js')(app)
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif